#include "stdafx.h"
#include "CImageList.h"


CImageList::CImageList()
	: m_hImageList(nullptr)
{
}


CImageList::~CImageList()
{
}

BOOL CImageList::Create(int cx, int cy, UINT nFlags, int nInitial, int nGrow)
{
	m_hImageList = ImageList_Create(cx, cy, nFlags, nInitial, nGrow);

	return m_hImageList != nullptr;
}

BOOL CImageList::DeleteImageList()
{
	return ImageList_Destroy(m_hImageList);
}

int CImageList::Add(HBITMAP hbmImage, COLORREF crMask)
{
	return ImageList_AddMasked(m_hImageList, hbmImage, crMask);
}

BOOL CImageList::BeginDrag(int nImage, POINT ptHotSpot)
{
	return ImageList_BeginDrag(m_hImageList, nImage, ptHotSpot.x, ptHotSpot.y);
}

void CImageList::EndDrag()
{
	ImageList_EndDrag();
}

BOOL CImageList::DragMove(POINT pt)
{
	return ImageList_DragMove(pt.x, pt.y);
}

BOOL CImageList::DragEnter(HWND hWndLock, POINT point)
{
	return ImageList_DragEnter(hWndLock, point.x, point.y);
}

BOOL CImageList::DragLeave(HWND hWndLock)
{
	return ImageList_DragLeave(hWndLock);
}
